window.onload=function(){
	
	function $(el){
		var a = document.querySelectorAll(el);
		if(a.length > 1){
			return a;
		}else{
			return a[0]
		}
	}


var sp = $('.sc').getElementsByTagName('span')


sp[0].addEventListener('click',function(){	
$('.dzgl').remove()
$('.all').style.display='none'
$('.sc').style.display='none'
localStorage.add=''
},false)

sp[1].addEventListener('click',function(){	
$('.sc').style.display='none'
$('.all').style.display='none'
},false)

$('.icon-bin').addEventListener('click',function(){
$('.sc').style.display='block'
$('.all').style.display='block'	
},false)


$('.span').addEventListener('click',function(){			 		 						
 	if($('.span>i').getAttribute('class')=='icon-checkbox-checked')	
 	{
 		$('.span>i').classList.dizhi('icon-checkbox-unchecked')
 		$('.span>i').classList.remove('icon-checkbox-checked')	 		 		
 		 $('.span').style.color="#ccc";
 		 $('.span>i').style.background="#FDF1E7";
  		 $('.span>i').style.color="#ccc";
 	}else{
  		$('.span>i').classList.dizhi('icon-checkbox-checked')
 		$('.span>i').classList.remove('icon-checkbox-unchecked')
 		$('.span').style.color="#FE5400";
 		$('.span>i').style.background="#fff"; 
 		$('.span>i').style.color="#FE542B"; 
 	}
			
}, false);			
 
 
	 if(localStorage.dizhi){
			 	$('.dzgl').style.display='block'
			 	var arr=localStorage.dizhi.split(",");			 	
			 	for(var i=0;i<arr.length;i++){
			 		console.log(arr[i])
			 	}			 	
			 	var a=localStorage.dizhi.split("-");			 	
			 	$('#lxr').innerText=a[0]
			 	$('#lxsj').innerText=a[1]
			 	$('#lxdz').innerText=a[2]
			}else{
			 	$('.dzgl').remove()
			}	
			

}